package top.yaofengqiao.springcloudsimple.auth.api.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * @author yfq
 * @date 2024/6/1 12:33
 * @description token校验结果
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class TokenAuthResultDTO implements Serializable {
    // 是否通过
    private Boolean pass;

    // 用户id
    private Long userId;

    // 用户名
    private String username;

    // 角色列表
    private List<String> roles;

    public boolean pass() {
        return Boolean.TRUE.equals(pass);
    }
}
